using System.Collections.Generic;
using UnityEngine;

public class StateDataContainer : DataContainer<AbstractState> {
	private string staticId = null;
	private string stateId = null;
	private long timestampCreation = -1;
	private long timestampUpdate = -1;

	public StateDataContainer ()
	{

	}
	
	public override void CopyTo (ReadOnlyable target)
	{
		if (!(target is StateDataContainer))
		{
			Debug.LogError("Target must be of type '" + typeof(StateDataContainer) + "'.");
			return;
		}

		StateDataContainer targetDataContainer = (StateDataContainer)target;

		base.CopyTo(targetDataContainer);

		targetDataContainer.StaticId = staticId;
		targetDataContainer.StateId = stateId;
		targetDataContainer.TimestampCreation = timestampCreation;
		targetDataContainer.TimestampUpdate = timestampUpdate;
	}

	public string StaticId
	{
		get
		{
			return staticId;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			staticId = value;
		}
	}
	
	public string StateId
	{
		get
		{
			return stateId;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			stateId = value;
		}
	}
	
	public long TimestampCreation
	{
		get
		{
			return timestampCreation;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			timestampCreation = value;
		}
	}
	
	public long TimestampUpdate
	{
		get
		{
			return timestampUpdate;
		}
		set
		{
			if (ReadOnly)
			{
				LogErrorWriteToReadOnly();
				return;
			}
			timestampUpdate = value;
		}
	}
}
